//
//  PPSocializationManager.h
//  pickpic
//
//  Created by Jinxiao on 9/17/16.
//  Copyright © 2016 MicroDream. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "PPSocializationUserObject.h"

typedef NS_ENUM(NSUInteger, PPSocializationType) {
    PPSocializationTypeWeixin = 2,
    PPSocializationTypeQQ = 4,
    PPSocializationTypeWeibo = 8,
};

typedef NS_ENUM(NSUInteger, PPSocializationShareType) {
    PPSocializationShareTypeWeixinChat = 1,
    PPSocializationShareTypeWeixinCircle = 2,
    PPSocializationShareTypeWeibo = 3,
    PPSocializationShareTypeQQChat = 4,
};

@interface PPSocializationManager : NSObject

+ (instancetype)sharedInstance;

- (BOOL)support:(PPSocializationType)type;

- (BOOL)handleOpenURL:(NSURL *)openURL;

@end

@interface PPSocializationManager (Login)

- (void)login:(PPSocializationType)type completion:(void (^)(PPSocializationType type, PPSocializationUserObject *user, NSError *error))completion;

@end

@interface PPSocializationManager (Share)

- (void)shareTitle:(NSString *)title subtitle:(NSString *)subtitle url:(NSString *)url image:(UIImage *)image type:(PPSocializationShareType)type;

- (void)shareTitle:(NSString *)title subtitle:(NSString *)subtitle url:(NSString *)url image:(UIImage *)image thumbnail:(UIImage *)thumbnail type:(PPSocializationShareType)type;

@end
